<template>
  <el-dialog
    :title="title"
    :close-on-click-modal="false"
    :visible.sync="visible"
    :before-close="cancel"
    class="JNPF-dialog JNPF-dialog_center"
    lock-scroll
    width="30%"
  >
    <el-row :gutter="15" class="">
      <el-form
        ref="elForm"
        :model="dataForm"
        :rules="rules"
        label-width="100px"
      >
       
       <el-col :span="24">
          <el-form-item label="公司名称" prop="FYEAR" >
            <el-input v-model="dataForm.FYEAR"   disabled/>
          </el-form-item>
        </el-col>

         
        <el-col :span="24">
          <el-form-item label="人员姓名" prop="FCATNAME" >
            <el-input v-model="dataForm.FCATNAME"  disabled />
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="有效起日" prop="FBEGDATE" >
            <el-date-picker v-model="dataForm.FBEGDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>

        </el-form-item>

        </el-col>

        <el-col :span="24">
          <el-form-item label="有效讫日" prop="FENDDATE" >
            <el-date-picker v-model="dataForm.FENDDATE" value-format="yyyy-MM-DD" type="date" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </el-col>

        <el-col :span="24">
            <el-form-item label="申请状态">
              <el-select v-model="dataForm.FBILLSTATE" placeholder="请选择">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>


      </el-form>
    </el-row>
    <span slot="footer" class="dialog-footer">
      <el-button @click="cancel">取 消</el-button>
      <el-button  v-if="insertorupdate" type="primary" v-loading="loading">确 定</el-button>
      <el-button v-else type="primary"  v-loading="loading">修 改</el-button>
    </span>
  </el-dialog>
</template>
<script>
import jnpf from "@/utils/jnpf"
export default {
  props: {
    parelist: {
      type: Array,
      default: []
    },
  },
  data() {
    return {
        title:"新增",
        dataForm:{
            FYEAR: "上海新梅化工",
            FPARENTNO: "1350***4043",
            FCLASS:"241001@qq.com",
            FCATNO: "上海奉贤海思路110号",
            FCATNAME: "宋江",
            FSEX: "男",
            FBEGDATE: "2024-12-01",
            FENDDATE: "2025-11-30",
            FBILLSTATE:"已开通",
            FNOTE:"",
            FOPERATOR: "system",
            FUPDDATE: "2011-02-16T02:57:02.000+00:00"
        },
        rules: {
          FCATNO: [
                { required: true, message: '请输入等级编号', trigger: 'blur' },
            ],
            FCATNAME: [
                { required: true, message: '请输入等级名称', trigger: 'blur' },
            ],
        },
        catlist:[
        {id:"10",fullName:"面食"},
        {id:"11",fullName:"零食"},
      ],
      fvisiblelist:[
        {id:"1",fullName:"是"},
        {id:"2",fullName:"否"},
      ],
      options1: [{
          value: 'L001',
          label: '未开通'
        }, {
          value: 'L002',
          label: '已开通'
        }],
      loading:false,
      visible:false,
      insertorupdate:true
    };
  },
  created() {
  },
  mounted() {},
  methods: {
    //
    init(id){
      this.dataForm.FCATNO= id || ''
        if(this.dataForm.FCATNO)
        {
            this.title="修改"
           this.insertorupdate=false;
        }
        else
        {
          this.insertorupdate=true;
            this.title="新增";
        }
        this.visible=true;
    },
    //
    cancel(){
        this.$refs.elForm.resetFields();
        this.visible=false;
    },
  },
};
</script>




